package Stack;

import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        MyStack myStack = new MyStack();

        // 队列
        Queue<Integer> queue = new LinkedList<>();

        queue.offer(1);
        queue.offer(2);
        queue.offer(3);

        System.out.println(queue.peek());// 1
        System.out.println(queue.poll());// 1
        System.out.println(queue.poll());// 2


        // 链表
        List<Integer> list = new LinkedList<>();
    }

    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();

        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);

        // pop()方法的返回值是 <E>
        Integer ret = stack.pop();
        System.out.println(ret);

        // 获取栈顶元素
        ret = stack.peek();
        System.out.println(ret);


    }
}
